Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: lenient chunk extension parsing leading to request smuggling issues #1899

Merged
merged 3 commits into from
Nov 24, 2024

Conversation

JeppW
Copy link
Contributor

@JeppW JeppW commented Nov 12, 2024

fasthttp allows newlines (\n) between the chunk size and the CRLF (i.e. in the chunk extension). This can cause request smuggling issues with some reverse proxies. This PR prevents this potential vulnerability by disallowing newlines in the chunk extension.

I've also corrected two unescaped carriage returns in error messages which messed with the output formatting.

@erikdubbelboer
Copy link
Collaborator

Can you fix the lint issue?

http.go:2518:13: fmt.Errorf can be replaced with errors.New (perfsprint)
  					error: fmt.Errorf("invalid character '\\n' after chunk size")

@JeppW
Copy link
Contributor Author

JeppW commented Nov 15, 2024

Should be okay now, can you rerun the workflows?

@erikdubbelboer erikdubbelboer merged commit 7b74fc9 into valyala:master Nov 24, 2024
15 checks passed
@erikdubbelboer
Copy link
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants